﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<span class="title1">积分换礼</span>
<br>
<c:choose>
	<c:when test="${categoryId==null}" >
		<span class="title1">
	</c:when>
	<c:otherwise>
		<span class="title">
	</c:otherwise>
</c:choose>
<html:link page="/shoparticle.mrqa?action=exchangelist">全部礼品</html:link>
</span>
<c:forEach var="category" items="${categoryList}" varStatus="index">
	<c:choose>
		<c:when test="${categoryId==category.id}" >
			<span class="title1">
		</c:when>
		<c:otherwise>
		<span class="title">
		</c:otherwise>
	</c:choose>
<html:link page="/shoparticle.mrqa?action=exchangelist&categoryId=${category.id}"><c:out value="${category.name}"/></html:link>
</span>
</c:forEach>
<table align="center" class="qlist" width="100%" cellpadding="0" cellspacing="0" style="border-top:0px;border-bottom:1px solid #ccc;border-left:1px solid #ccc;border-right:1px solid #ccc;">
  <c:forEach var="article" items="${articleList}" varStatus="index">
    <c:if test="${(index.count)%2 != 0}">
      <tr class="even" style="color:Black;">
     </c:if>
     		<td width="15%" valign="top" style="vertical-align: top;border-top:1px solid #ccc;">
     			<img src="<%=com.mr.qa.GlobalConfigs.ARTICLEIMAGE_DIR%><c:out value='${article.picture}' />" width="114" height="160" border="1" style="border:1px solid black;" />
     			<c:if test="${article.quantity!=0}">
     			<center><html:link page="/shoparticle.mrqa?action=preexchange&id=${article.id}&page=${page}&pageSize=${pageSize}"><img src="qa/images/duihuan.jpg"></html:link></center>
     			</c:if>
     			<c:if test="${article.quantity==0}">
     			<center><font color="grey">该物品已被兑完</font></center>
     			</c:if>
     		</td>
     		<td width="35%" valign="top" style="vertical-align: top;border-top:1px solid #ccc;">
     			<b>【名称】&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${article.name}"/></b><br />
     			【类别】&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${article.category.name}"/><br />
     			【积分】&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${article.money}"/><br />
     			【数量】&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${article.quantity}"/><br />
     			【说明】&nbsp;&nbsp;&nbsp;&nbsp;<span title="<c:out value="${article.description}"/>"><c:out value="${fn:substring(article.description,0,150)}"/>
     					<c:if test="${fn:length(article.description)>150}">
     						.....
     					</c:if>
     				</span>
     		</td>
     	<c:if test="${(fn:length(articleList)%2==1)&&fn:length(articleList)==index.count}">
     		<td width="15%" valign="top" style="vertical-align: top;border-top:1px solid #ccc;">&nbsp;</td>
     		<td width="35%" valign="top" style="vertical-align: top;border-top:1px solid #ccc;">&nbsp;</td>
    	</c:if>
   <c:if test="${(index.count)%2 == 0}">
    </tr>
   </c:if>
 </c:forEach>
</table>
<qautil:page action="/shoparticle.mrqa"/>